package secondtest.po;

import java.util.Date;
import java.util.List;

public class Order {
    //由于查询订单信息并附带用户信息时，此类不能够映射所有的参数，当使用 ResultMap 来映射时
    //要在本类中添加 User 属性，用于接收那不能被映射的 User 信息部分
    private User user;

    public List<OrderDetail> getListDetail() {
        return listDetail;
    }

    public void setListDetail(List<OrderDetail> listDetail) {
        this.listDetail = listDetail;
    }

    //由于一个订单会有多个订单明细，所以需要使用 List 将订单明细保存起来
    private List<OrderDetail> listDetail;

    private int id;
    private int user_id;
    private int number;
    private Date createtime;
    private String note;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "Order{" +
                ", listDetail=" + listDetail.toString() +
                ", id=" + id +
                ", user_id=" + user_id +
                ", number=" + number +
                ", createtime=" + createtime +
                ", note='" + note + '\'' +
                '}';
    }
}
